package bank;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.regex.Pattern;

public class FindMoney extends JPanel implements ActionListener {
    private Atm frame;

    private Icon btnOff = Util.getIcon("/images/buttonOff.jpg");
    private JButton imageBtn1 = new JButton(btnOff);
    private JLabel accountText = new JLabel();



    public FindMoney(Atm frame) {
        this.frame = frame;
        this.setLayout(null);
        this.setOpaque(false);

        JLabel save = new JLabel("查询余额");
        save.setBounds(50, 50, 100, 50);
        this.add(save);


        JLabel acc = new JLabel("余额:");
        acc.setFont(new Font("宋体", Font.PLAIN, 30));
        acc.setBounds(300, 200, 100, 50);
        this.add(acc);


        accountText.setBounds(400, 200, 300, 50);
        accountText.setFont(new Font("宋体", Font.PLAIN, 30));
        this.add(accountText);

        imageBtn1.setBounds(650, 430, 140, 50);
        this.add(imageBtn1);
        imageBtn1.addActionListener(this);


    }

    public JLabel getAccountText() {
        return accountText;
    }

    public void setAccountText(JLabel accountText) {
        this.accountText = accountText;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == imageBtn1) {

            frame.switchPanel("menu");
        }
    }
}
